<?php

use think\migration\Migrator;
use think\migration\db\Column;

class TableAddFieldCodeByTeam extends Migrator
{

    public function up()
    {
        $this->table('team')
            ->addColumn(Column::string('code', 20)->setComment('邀请码')->setNullable())
            ->addIndex('code')
            ->update();
    }

    public function down()
    {
        $this->table('team')->removeColumn('code')->removeIndex('code');
    }
}
